<template>
  <div class="car">
    <!-- 导航栏 -->
    <van-nav-bar
      title="收藏"
      left-arrow
      right-text="编辑"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />

    <main>
      <van-empty
        v-if="isShow"
        class="custom-image"
        image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
        description="您的购物车空空如也"
      >
        <router-link to="/feilei">
          <van-button round class="bottom-button">去逛一逛</van-button>
        </router-link>
      </van-empty>
      <!-- v-else v-for="(item, index) in 1" :key="index" -->
      <div class="outbox" v-for="(item, index) in collectionInfo" :key="index">
        <router-link :to="`/detail/${item.gid}`">
          <van-card
            price="99"
            :desc="item.subtitle"
            :title="item.title"
            :thumb="item.img"
          >
            <template #tags>
              <van-tag plain type="danger">正品</van-tag>
              <van-tag plain type="danger">便宜</van-tag>
            </template>
          </van-card>
        </router-link>
      </div>
    </main>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: false, //是否显示收藏栏
      goodList: null,
    };
  },
  computed: {
    collectionInfo() {
      return this.$store.state.collection.collectionList;
    },
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      // console.log(location.hash);
    },
  },
};
</script>

<style lang="less" scoped>
</style>